﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BotonJXC.DAO;
using BotonJXC.Entity;

namespace BotonJXC.BLL
{
    public class InStocksBll : BaseBLL<InStocksDao, InStocks, int>
    {
        public InStocksBll() { }

        /// <summary>
        /// 根据入库单编号查询订单
        /// </summary>
        /// <param name="orderSn"></param>
        /// <returns></returns>
        public InStocks findInStocksBySn(string InSn, string CreatePlace)
        {

            IList<InStocks> list = base.Dao.findInStocksBySn(InSn, CreatePlace);
            if (list != null && list.Count > 0)
            {
                return list[0];
            }
            else
            {
                return null;
            }
        }


        public bool SaveInStocks(InStocks InStocks)
        {
            try
            {
                this.Dao.SaveInStocks(InStocks);
                return true;
            }
            catch (Exception)
            {
                return false;
                throw;
            }
        }

      
        public bool DeleteInStocks(InStocks InStocks)
        {
            try
            {
                this.Dao.DeleteInStocks(InStocks);
                return true;
            }
            catch (Exception)
            {
                return false;
                throw;


            }

        }
        public PageModel<InStocks> FindPage(InStocks InStocks, DateTime begintime, DateTime endtime, int start, int count)
        {
            return this.Dao.FindPage(InStocks, begintime, endtime, start, count);
        }
        public PageModel<InStocks> FindPage(InStocks InStocks , int start, int count)
        {
            return this.Dao.FindPage(InStocks, start, count);
        }
    }
}
